package com.dnw.util;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created by yangyu on 2017/12/6.
 */

public class DownloadProgressReceiver extends BroadcastReceiver {
    private String  name;
    private int     progress;
    private Message message;

    @Override
    public void onReceive(Context context, Intent intent) {
        name = intent.getStringExtra("name");
        progress = intent.getIntExtra("progress", 0);
        message.update(name, progress);
    }

    public interface Message  {
        public void update(String name, int progress);
    }

    public void setMessage(Message message) {
        this.message = message;
    }

}